<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>登录</title>
	<link rel="icon" type="image/x-icon" href="${ctx}/favicon.ico">
	<link rel="stylesheet" href="css/login.css"/>
	<link href="css/plugins/iCheck/custom.css" rel="stylesheet">
	<script>if (window.top !== window.self) {
		window.top.location = window.location;
	}</script>
</head>
<style>
	.errorword, label.error {
		padding-left: 16px;
		padding-bottom: 2px;
		font-weight: bold;
		font-size: 14px;
		color: red;
	}
</style>
<body>
<div class="login">
	<div class="message">全国盲人医疗按摩人员考试实践技能命题系统</div>
	<div id="darkbannerwrap"></div>
	<form method="post" action="${ctx}/loginUser" method="post" id="loginForm">
		<input name="username" placeholder="用户名" required="" type="text" value="${username!""}">
		<hr class="hr15">
		<input name="password" placeholder="密码" required="" type="password">
		<hr class="hr15">
		<label class="i-checks">
			<input name="rememberMe" value="true" type="checkbox">&nbsp;记住密码
		</label>
		<div id="error"></div>
		<hr class="hr15">

    <#if status??>
        <#if status == '1001'>
			<label class="errorword">用户名不存在！</label>
        </#if>
        <#if status ==  '1002'>
			<label class="errorword">账户密码错误，请重新输入！</label>
        </#if>
        <#if status == '1003'>
			<label class="errorword">网络异常</label>
        </#if>
    </#if>
		<input value="登录" id="loginbtn" class="loginbtn" style="width:100%;" type="submit">
		<hr class="hr20">
	</form>

</div>
<script src="js/jquery.min.js?v=2.1.4"></script>
<script src="js/bootstrap.min.js?v=3.3.6"></script>
<script src="js/plugins/layer/layer.js"></script>
<script src="js/plugins/validate/jquery.validate.min.js"></script>
<script src="js/plugins/validate/messages_zh.min.js"></script>
<script src="js/plugins/iCheck/icheck.min.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$(".i-checks").iCheck({checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green",})
	});
	$(document).ready(function () {
		// 在键盘按下并释放及提交后验证提交表单
		var validator = $("#loginForm").validate({
			submitHandler: function (form) {
				form.submit();
			},
			errorLabelContainer: "#error",
			errorPlacement: function (error, element) {
				var info = "<span id='error'>" + error + "</span>";
				element.closest('#error').append(error);//显示错误消息提示
			},
			rules: {
				username: {
					required: true
				},
				password: {
					required: true
				}
			},
			messages: {
				username: {
					required: "请输入用户名！",
				},
				password: {
					required: "请输入密码！",
				}
			}
		});
	});
</script>
</body>
</html>
